getApp();

Component({
    properties: {
        options: {
            type: Object,
            value: {}
        },
        route: {
            type: String,
            value: ""
        }
    },
    data: {
        ing: !1,
        show: !1,
        saving: !1
    },
    methods: {
        close: function() {
            this.setData({
                ing: !1,
                show: !1,
                saving: !1
            });
        },
        showqr: function(o) {
            wx.switchTab({
                url: "/pages/index/index"
            });
        },
        saveToAlbum: function(o) {
            wx.navigateTo({
                url: "/pages/index/index"
            });
        },
        doSaveToAlbum: function() {
            var o = this;
            wx.downloadFile({
                url: this.data.qr,
                success: function(s) {
                    console.log("下载文件：success"), console.log(s), o.setData({
                        saving: !1
                    }), wx.saveImageToPhotosAlbum({
                        filePath: s.tempFilePath,
                        success: function(s) {
                            console.log("保存图片：success"), wx.showToast({
                                title: "保存成功"
                            }), o.setData({
                                show: !1
                            });
                        },
                        fail: function(o) {
                            wx.showToast({
                                title: "保存失败[2]"
                            }), console.log("保存图片：fail"), console.log(o);
                        }
                    });
                },
                fail: function(s) {
                    o.setData({
                        saving: !1
                    }), console.log("下载文件：fail"), console.log(s), wx.showToast({
                        title: "保存失败[3]"
                    });
                }
            });
        }
    }
});